package com.fa4j.common.web.annotation;


import com.fa4j.common.web.model.AppType;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * 接口注解
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Operation
@Documented
public @interface ApiMethod {

    /**
     * 接口名称
     */
    @AliasFor(annotation = Operation.class, attribute = "summary")
    String name();

    /**
     * 接口类型
     */
    AppType[] type();


    /**
     * 登录开关
     */
    Switch login() default Switch.AUTO;

    /**
     * 权限开关
     */
    Switch auth() default Switch.AUTO;

    /**
     * 记录开关
     */
    Switch record() default Switch.AUTO;


    enum Switch {
        AUTO, ON, OFF,
    }

}
